#include <iostream>
#include <thread>
#include <string>
#include <future>
#include <chrono>
int main()
{
    std::string str;
    str = "Hello";
    auto future = std::async(std::launch::async, []()
                             {
        std::this_thread::sleep_for(std::chrono::seconds(2));
        return "_world"; });
    auto start = std::chrono::system_clock::now();
    str += future.get();
    auto end = std::chrono::system_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
    std::cout << " After " << duration.count() << " microseconds " << std::endl;
    std::cout << "str has been processd and its value is " << str << std::endl;
    return 0;
}